
package com.verify.repository;

import com.baomidou.mybatisplus.extension.service.IService;
import com.verify.data.domain.ExcelPersonnel;
import com.verify.data.domain.ExcelUnit;
import com.verify.data.domain.JobType;
import com.verify.mapper.ExcelUnitMapper;
import com.verify.mapper.JobTypeMapper;
import com.verify.repository.base.BaseRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Optional;

@Service
@RequiredArgsConstructor
public class JobTypeRepository extends BaseRepository<JobTypeMapper, JobType>
        implements IService<JobType> {

    public List<JobType> listByOrgCode(String orgCode) {
        return list(baseQuery().eq(JobType::getOrgCode, orgCode));
    }

    public JobType getByNameAndOrgCode(String positionTypeName, String orgCode) {
        return getOne(baseQuery().eq(JobType::getPositionTypeName, positionTypeName).eq(JobType::getOrgCode, orgCode));
    }
}
